package a;
import java.util.Scanner;

public class ArrayUtils {
	static class PairResult {
		private double min;
		private double max;

		public PairResult(double min, double max) {
			this.min = min;
			this.max = max;
		}

		public double getMin() {
			return min;
		}

		public void setMin(double min) {
			this.min = min;
		}

		public double getMax() {
			return max;
		}

		public void setMax(double max) {
			this.max = max;
		}

		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}

	}

	static PairResult findMinMax(double[] values) {
		PairResult p = new PairResult(values[0], values[0]);
		for (int i = 0; i < values.length; i++) {
			if (values[i] > p.max) {
				p.max = values[i];
			}
		}
		for (int j = 0; j < values.length; j++) {
			if (values[j] < p.min) {
				p.min = values[j];
			}
		}
		return p;

	}

	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		int n = a.nextInt();
		double[] d = new double[n];
		for (int i = 0; i < n; i++) {
			double dd = a.nextDouble();
			d[i] = dd;
		}
		PairResult pr = ArrayUtils.findMinMax(d);
		System.out.println(pr);
		System.out.println(ArrayUtils.PairResult.class);
	}

}
